package com.deepocean.controller;

import com.deepocean.common.entity.ResultEntity;
import com.deepocean.entity.DenseMediumCycloneCondition;
import com.deepocean.entity.DenseMediumCycloneEntity;
import com.deepocean.service.IDenseMediumCycloneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 重介旋流器
 */

@RestController
@RequestMapping("/denseMediumCyclone")
public class DenseMediumCycloneController {
    @Autowired
    IDenseMediumCycloneService denseMediumCycloneService;

    /**
     * 新增接口
     * @param denseMediumCycloneEntity
     * @return
     */
    @PostMapping("/v1/add")
    public ResultEntity add(@RequestBody DenseMediumCycloneEntity denseMediumCycloneEntity) {
        return ResultEntity.success(denseMediumCycloneService.add(denseMediumCycloneEntity));
    }

    /**
     * 一小时内物料输入输出总和
     * @param deviceId
     * @return
     */
    @PostMapping("/v1/getInAndOutInHour")
    public ResultEntity getInAndOutInHour(@RequestParam String deviceId) {
        return ResultEntity.success(denseMediumCycloneService.getInAndOutInHour(deviceId));
    }

    /**
     * 条件查询
     * @param denseMediumCycloneCondition
     * @return
     */
    @PostMapping("/v1/getDenseMediumCycloneByCondition")
    public ResultEntity getDenseMediumCycloneByCondition(@RequestBody DenseMediumCycloneCondition denseMediumCycloneCondition) {
        return ResultEntity.success(denseMediumCycloneService.getDenseMediumCycloneByCondition(denseMediumCycloneCondition));
    }

    /**
     * 根据设备型号获取理论数据
     * @return
     */
    @PostMapping("/v1/getTheoryData")
    public ResultEntity getTheoryData(String deviceType) {
        return ResultEntity.success("理论数据");
    }
}
